package jp.co.baka.gae.lib;

import java.io.IOException;
import java.util.logging.Logger;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slim3.controller.Controller;
import org.slim3.controller.FrontController;
import org.slim3.controller.Navigation;
import org.slim3.controller.RequestHandler;

public class MyFrontController extends FrontController {


    /**
     * The logger.
     */
    protected static final Logger logger =
        Logger.getLogger(MyFrontController.class.getName());
    
    
    
    @Override
    protected void processController(HttpServletRequest request,
            HttpServletResponse response, Controller controller)
            throws IOException, ServletException {
        
        

        RequestHandler requestHandler = createRequestHandler(request);
        requestHandler.handle();
        Navigation navigation = controller.runBare();
        
        handleNavigation(request, response, controller, navigation);
        
        
        
    }
    
    
//    public static final String JSP_ROOT_PATH = "/WEB-INF/jsp";
//
//
//
//    @Override
//    protected void doForward(HttpServletRequest request,
//            HttpServletResponse response, String path) throws IOException,
//            ServletException {
//
//        path = JSP_ROOT_PATH + path;
//
//        RequestDispatcher rd = servletContext.getRequestDispatcher(path);
//        if (rd == null) {
//            response.sendError(
//                HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
//                "The request dispatcher specified by the path("
//                    + path
//                    + ") is not found.");
//            return;
//        }
//        rd.forward(request, response);
//    }
}
